package scream.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import scream.dao.BastanteoDAO;
import scream.dao.ClienteDAO;
import scream.excepcion.DAOExcepcion;

/**
 * Servlet implementation class Carga_Lista_ClienteBastanteo_Servlet
 */
@WebServlet("/Carga_Lista_ClienteBastanteo_Servlet")
public class Carga_Lista_ClienteBastanteo_Servlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
   
	
	
	
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Carga_Lista_ClienteBastanteo_Servlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		BastanteoDAO c = new BastanteoDAO();
		try {
			request.setAttribute("vclis", c.listar_clientes());
			
			RequestDispatcher rd = request
			.getRequestDispatcher("Lista_Clientes_Bastanteo.jsp");
			rd.forward(request, response);
			
			
		} catch (DAOExcepcion e) {
			e.printStackTrace();
		}
		
	}

}
